﻿<%@ Page Title="" Language="C#" MasterPageFile="~/CricketAdmin.master" AutoEventWireup="true"
    CodeFile="SessionReport.aspx.cs" Inherits="SessionReport" %>

<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="Server">
    <style type="text/css">
        body
        {
            font-family: Arial;
            font-size: 10pt;
        }
        .Grid td
        {
            background-color: #A1DCF2;
            color: black;
            font-size: 10pt;
            line-height: 200%;
        }
        .Grid th
        {
            background-color: #3AC0F2;
            color: White;
            font-size: 10pt;
            line-height: 200%;
            text-align: left;
        }
        .ChildGrid td
        {
            background-color: #eee !important;
            color: black;
            font-size: 10pt;
            line-height: 200%;
        }
        .ChildGrid th
        {
            background-color: #6C6C6C !important;
            color: White;
            font-size: 10pt;
            line-height: 200%;
        }
        .Nested_ChildGrid td
        {
            background-color: #fff !important;
            color: black;
            font-size: 10pt;
            line-height: 200%;
            width: 14px;
            font-weight: bold;
        }
        .Nested_ChildGrid th
        {
            background-color: #2B579A !important;
            color: White;
            font-size: 10pt;
            line-height: 200%;
        }
    </style>
    <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("[id*=imgOrdersShow]").each(function () {

                if ($(this)[0].src.indexOf("minus") != -1) {
                    $(this).closest("tr").after("<tr><td></td><td colspan = '999'>" + $(this).next().html() + "</td></tr>");
                    $(this).next().remove();
                }
            });
            $("[id*=imgProductsShow]").each(function () {
                if ($(this)[0].src.indexOf("minus") != -1) {
                    $(this).closest("tr").after("<tr><td></td><td colspan = '999'>" + $(this).next().html() + "</td></tr>");
                    $(this).next().remove();
                }
            });
        });
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="Server">
    <div class="container-fluid">
        <h3 class="page-title">
            Session Report<small></small>
        </h3>
        <%--<ul class="breadcrumb">
            <li><i class="icon-home"></i>Home<span class="icon-angle-right"> </span></li>
            <li>Report<span class="icon-angle-right"></span></li>
            <li>Session</li>
        </ul>--%>
        <div class="alert alert-danger" id="layerError" runat="server" style="display: none;">
        </div>
        <div class="alert alert-success" id="layerSuccess" runat="server" style="display: none;">
        </div>
        <div class="row-fluid">
            <div class="span12">
                <div class="portlet box blue">
                    <div class="portlet-title">
                        <div class="caption">
                            Session Report</div>
                    </div>
                    <div class="portlet-body form">
                        <div class="form-horizontal form-view">
                            <div class="row-fluid">
                                <div class="span12">
                                    <div class="control-group">
                                        <label class="control-label">
                                            Match <span class="required">*</span></label>
                                        <div class="controls">
                                            <asp:DropDownList ID="drpMatch" runat="server">
                                            </asp:DropDownList>
                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Please select match"
                                                InitialValue="0" ValidationGroup="SessionReport" CssClass="required" ControlToValidate="drpMatch"
                                                Display="Dynamic"></asp:RequiredFieldValidator>
                                        </div>
                                    </div>
                                </div>
                            </div>
                            <div class="form-actions">
                                <asp:Button ID="btnSubmit" runat="server" Text="Submit" CssClass="btn red" ValidationGroup="SessionReport"
                                    OnClick="btnSubmit_Click" />
                            </div>
                            <div class="row-fluid">
                                <div class="span12">
                                    <asp:GridView ID="grdBookie" runat="server" AutoGenerateColumns="false" CssClass="Grid"
                                        DataKeyNames="BookieId" Width="100%">
                                        <Columns>
                                            <asp:TemplateField>
                                                <ItemTemplate>
                                                    <asp:ImageButton ID="imgOrdersShow" runat="server" OnClick="Show_Hide_OrdersGrid"
                                                        ImageUrl="~/images/plus.png" CommandArgument="Show" />
                                                    <asp:Panel ID="pnlOrders" runat="server" Visible="false" Style="position: relative">
                                                        <asp:GridView ID="grdCustomers" runat="server" AutoGenerateColumns="false" PageSize="1000"
                                                            AllowPaging="true" OnPageIndexChanging="OnOrdersGrid_PageIndexChanging" CssClass="ChildGrid"
                                                            DataKeyNames="CustomerId" Width="100%">
                                                            <Columns>
                                                                <asp:TemplateField>
                                                                    <ItemTemplate>
                                                                        <asp:ImageButton ID="imgProductsShow" runat="server" OnClick="Show_Hide_ProductsGrid"
                                                                            ImageUrl="~/images/plus.png" CommandArgument="Show" />
                                                                        <asp:Panel ID="pnlProducts" runat="server" Visible="false" Style="position: relative">
                                                                            <asp:GridView ID="grdAllCustomers" runat="server" AutoGenerateColumns="false" PageSize="1000"
                                                                                AllowPaging="true" OnPageIndexChanging="OnProductsGrid_PageIndexChanging" CssClass="Nested_ChildGrid"
                                                                                Width="100%">
                                                                                <Columns>
                                                                                    <asp:BoundField DataField="Over" HeaderText="Over" />
                                                                                    <asp:BoundField DataField="Runs" HeaderText="Runs" />
                                                                                    <asp:BoundField DataField="BettingFor" HeaderText="Betting For" />
                                                                                    <asp:BoundField DataField="Rate" HeaderText="Rate" />
                                                                                    <asp:BoundField DataField="ActualRun" HeaderText="Actual Run" />
                                                                                    <asp:BoundField DataField="BettingAmount" HeaderText="Chips" />
                                                                                    <asp:BoundField DataField="Date" HeaderText="Date" />
                                                                                </Columns>
                                                                            </asp:GridView>
                                                                        </asp:Panel>
                                                                    </ItemTemplate>
                                                                    <ItemStyle Width="10px" />
                                                                </asp:TemplateField>
                                                                <asp:BoundField DataField="CustomerName" HeaderText="Customer Name" />
                                                                <asp:BoundField DataField="BettingAmount" HeaderText="Chips" />
                                                            </Columns>
                                                        </asp:GridView>
                                                    </asp:Panel>
                                                </ItemTemplate>
                                                <ItemStyle Width="10px" />
                                            </asp:TemplateField>
                                            <asp:BoundField ItemStyle-Width="450px" DataField="BookieName" HeaderText="Contact Name" />
                                            <asp:BoundField ItemStyle-Width="150px" DataField="BettingAmount" HeaderText="Chips" />
                                        </Columns>
                                    </asp:GridView>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</asp:Content>
